home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
earkit
/
mail
/
thor
/
thorftp.lha
/
thorftp
/
ThorFTP.br
next >
Wrap
Text File
|
1996-06-17
|
4KB
|
123 lines
/* ThorFTP.br V1.1 © 1996 Roy Brown
$ver: ThorFTP.br V1.1 (17.6.96)
ThorFTP will take Thor Download Events and turn them into an EMail Event.
It will address this new Event to the configured FTP Mail server.
It can be run either from within Thor (when leaving a system perhaps), or from a shell
(or DOpus button). Thor does not need to be running.
It has been tested with src.doc.ic.ac.uk (The main UK Aminet mirror) and
ftp.uni-paderborn.de (Paderborn University in Germany).
Commands for other FTP Mail servers may differ. */
/* Variables - set these to match your system */
SystemName ='Internet' /* The name of your mail/news system in Thor. */
EMailConf ='EMail' /* Your EMail conference. */
ToWhom ='FTP Mail' /* For the 'To' line. Can be anything you like */
ToWhere ='ftpmail@doc.ic.ac.uk' /* FTP mail server address. */
/* For the UK use 'ftpmail@doc.ic.ac.uk'. */
/* For Germany use 'ftp-mail@uni-paderborn.de'.*/
Subjeck ='FTP by Email' /* For the 'Subject' line. Anything you like. */
/*** There should be no reason to alter anything below here, although Kev Cowans probably will ;) ***/
Options results
Options failat 21
/* The variables below set the commands used in the script sent to the FTPmail server.
These differ slightly from server to server. */
Aminetpath ='pub/aminet/' /* The Aminet directory */
If ToWhere='ftpmail@doc.ic.ac.uk' Then
Do
Start='open'
Code ='mime'
End
If ToWhere='ftp-mail@uni-paderborn.de' Then
Do
Start='begin'
Code ='uuencode'
End
/* Check for BBSRead port. Open if necessary */
If ~Show('P','BBSREAD') Then
Do
Address Command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
'WaitForPort BBSREAD'
End
HW=0 /* Text file not open */
/* Get number of Events waiting to be sent */
EDF_ACTIVE = '00000000'x /* Event is active */
EVE_ENTERMSG = 0 /* Enter message */
EVE_DOWNLOAD = 4 /* Download File */
Address BBSREAD
GETBBSDATA SystemName stem BBSDATA
If BBSDATA.NUMEVENTS ~= 0 Then
Do num=BBSDATA.FIRSTEVENT To BBSDATA.LASTEVENT
READBREVENT systemname EVENTNR num TAGSSTEM eventtag DATASTEM eventdata
If EVENTDATA.FLAGS=EDF_ACTIVE Then
If EVENTDATA.EVENTTYPE~=EVE_DOWNLOAD Then
Iterate num
Else
Do
RemoteFile='get 'AminetPath||EVENTTAG.DIRECTORY||'/'||EVENTTAG.FILENAME
Call WriteText
UPDATEBREVENT BBSNAME systemname EVENTNR num SETDONE
Iterate num
End
End
Else
Exit
/* If all Download Events processed, complete text file and close it */
If HW ~=0 Then
Do
String=WriteLn(FTP,'quit')
Closed=Close(FTP)
Call EventWrite
End
Address Command 'Delete >NIL: T:ThorFTP.txt'
Exit
/* Write the text file for the Email */
WriteText:
If HW=0 Then
Do
a=Open(FTP,"T:ThorFTP.txt",w) /* Open text file */
String=WriteLn(FTP,Start)
HW=1
End
String=WriteLn(FTP,Code)
String=WriteLn(FTP,RemoteFile)
Return
/* Write the new EMail Event */
EventWrite:
Address BBSREAD
EVE_ENTERMSG = 0 /* 'Enter' message type */
Drop BBSDATA.
UNIQUEMSGFILE bbsname SystemName stem Text FROMFILE 'T:ThorFTP.txt'
BBSDATA.TONAME = ToWhom
BBSDATA.TOADDR = ToWhere
BBSDATA.SUBJECT = Subjeck
BBSDATA.CONFERENCE = EMailConf
BBSDATA.MSGFILE = Text.FILEPART
WRITEBREVENT bbsname SystemName event EVE_ENTERMSG stem BBSDATA
Return